Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@slidev/client
create-slidev
create-slidev-theme
@slidev/parser
@slidev/cli
@slidev/types
commit: |
There was a problem hiding this comment.
Pull request overview
This PR refactors and fixes the VSCode extension with significant architectural changes to improve project management, server detection, and state synchronization.
Key changes:
- Migrated from
createSingletonComposabletodefineServicefor better service management - Reworked project lifecycle management with proper scoping and cleanup
- Refactored server detection to support multiple ports and auto-discovery
- Improved slide navigation and focus tracking with debouncing
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Added picomatch and yaml-language-server dependencies to vscode catalog |
| pnpm-lock.yaml | Updated lockfile with new dependencies and minor version bumps |
| packages/vscode/syntaxes/*.md | Updated example markdown files for syntax testing |
| packages/vscode/src/views/slidesTree.ts | Refactored slides tree with new drag-and-drop logic and project-relative tracking |
| packages/vscode/src/views/serverTerminal.ts | Removed standalone file (functionality moved to useDevServer) |
| packages/vscode/src/views/projectsTree.ts | Updated to use defineService and changed label/description layout |
| packages/vscode/src/views/previewWebview.ts | Refactored preview state management and sync logic |
| packages/vscode/src/views/foldings.ts | Migrated to defineService pattern |
| packages/vscode/src/views/annotations.ts | Improved decorator definitions and added Unicode space character comment |
| packages/vscode/src/utils/getSlidesTitle.ts | Added fallback to basename when title is missing |
| packages/vscode/src/utils/getSlideNo.ts | Removed file (functionality relocated) |
| packages/vscode/src/projects.ts | Major refactor with effect scopes, file watchers, and improved lifecycle management |
| packages/vscode/src/lmTools.ts | Updated to use new focused slide composable |
| packages/vscode/src/index.ts | Added try-catch for language model tools initialization |
| packages/vscode/src/html/error.ts | Updated to use project.port.value instead of project.port |
| packages/vscode/src/configs.ts | Simplified config exports by removing ref wrappers |
| packages/vscode/src/composables/useServerDetector.ts | Complete refactor to support multi-port detection and auto-discovery |
| packages/vscode/src/composables/usePreviewState.ts | Removed file (functionality merged into previewWebview) |
| packages/vscode/src/composables/useFocusedSlideNo.ts | Removed file (replaced by useFocusedSlide) |
| packages/vscode/src/composables/useFocusedSlide.ts | New composable combining slide navigation and focus tracking |
| packages/vscode/src/composables/useEditingSlideSource.ts | Removed file (replaced by useFocusedSlide) |
| packages/vscode/src/composables/useDevServer.ts | Refactored to return scoped server instances with integrated terminal |
| packages/vscode/src/composables/useDebouncedComputed.ts | New utility for debounced computed values |
| packages/vscode/src/commands.ts | Updated commands to work with new project structure and improved entry selection |
| packages/vscode/package.json | Changed activation event and updated command titles/enablement conditions |
| packages/vscode/language-server/volar-service-yaml.ts | Removed outdated ts-expect-error comment |
| packages/types/src/types.ts | Fixed typo and improved YAML document type annotation |
| packages/parser/src/fs.ts | Changed to support async file loading with custom source function |
| packages/client/composables/useEmbeddedCtrl.ts | Reduced throttle from 300ms to 50ms for more responsive updates |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/vscode/src/commands.ts:68
- When removing an entry, the code calls
projects.delete(entry)directly instead of using theremoveProject(entry)function defined in projects.ts. This bypasses proper cleanup logic that includes stopping the project scope and clearing the active entry. Consider usingremoveProject(entry)instead.
useCommand('slidev.remove-entry', async (node: any) => {
const entry = slash(node.treeItem.resourceUri.fsPath)
if (activeEntry.value === entry)
activeEntry.value = null
projects.delete(entry)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…o rework-vscode
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 30 changed files in this pull request and generated 8 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/vscode/package.json:198
- The
slidev.stop-devcommand is removed from the command palette and menus in package.json (lines 193-198 and 332-337 deleted), but the command handler still exists in commands.ts. This creates an inconsistency - the command can still be invoked programmatically but won't be visible to users. Either remove the command handler entirely or keep it in the UI if users need this functionality.
{
"command": "slidev.open-in-browser",
"category": "Slidev",
"title": "Open slides in browser",
"icon": "$(globe)"
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When developing https://github.com/kermanx/p2p-live-share, I found I was wrong in many things about VSCode extension development. This PR reworks the extension and resolves multiple bugs, reported or unreported.
fix #2336